package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.Technician;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.BrokerConsumeDetailService;
import com.rm.zeyou.util.login.TechnicianLoginUtil;
import com.rm.zeyou.vo.request.BrokerIncomeVo;
import com.rm.zeyou.vo.response.BrokerIncomeResponseBaseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 经纪人佣金记录表 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:07
 */
@Api(tags = "经纪人佣金相关")
@RestController
@RequestMapping("/api/brokerConsumeDetail")
public class BrokerConsumeDetailController {
    @Resource
    private BrokerConsumeDetailService brokerConsumeDetailService;
    @Resource
    private TechnicianLoginUtil technicianLoginUtil;

    @ApiOperation(value = "经纪人收益")
    @PostMapping("brokerIncome")
    @SaCheckLogin(type = "technician")
    public ApiRestResponse<BrokerIncomeResponseBaseVo> brokerIncome(@RequestBody BrokerIncomeVo requestVo) {
        Technician technician = technicianLoginUtil.getTechnician();
        return brokerConsumeDetailService.brokerIncome(technician,requestVo);
    }

}
